
package com.wangan.wanganpush.timer;

import com.wangan.wanganpush.services.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;



/**
 * 定时推送数据
 */

@Component
@PropertySource(value = "classpath:application.yml")
public class PushScheduled {

    @Autowired
    LoginImpl userloginImpl;

    @Autowired
    RegImpl regImpl;

    @Autowired
    TrajectoryImpl trajectoryImpl;

    @Autowired
    VehicleImpl vehicleImpl;

    @Autowired
    OrderInfoImpl orderInfoImpl;


/**
     * userLogin表查询数据sdg
     */

    @Scheduled(cron ="${myProps.cron}")
    public void  getUserLoginData(){
        try {
            userloginImpl.userLoginPush();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }



/**
     * 推送 userReg表
     */

    @Scheduled(cron ="${myProps.cron}")
    public void  getUserRegData(){
        try {
            regImpl.userRegPush();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }



/**
     * 推送 Trajectory
     */

    @Scheduled(cron ="${myProps.cron}")
    public void  getTrajectoryData(){
        try {
            trajectoryImpl.trajectoryPush();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    @Scheduled(cron ="${myProps.cron}")
    public void  getVehicleImplData(){
        try {
            vehicleImpl.vehiclePush();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Scheduled(cron ="${myProps.cron}")
    public void  getUserOrderInfoData(){
        try {
            orderInfoImpl.userOrderInfoPush();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


}



